/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author LYS
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../../../model/baseModel';

const { adminPath } = useGlobSetting();

export interface BasLine extends BasicModel<BasLine> {
  code?: string; // 产线编码
  name?: string; // 产线名称
  workShopCode?: string; // 归属车间
  jobType?: string; // 作业类型
  lineType?: string; // 产线类型
}

export const basLineList = (params?: BasLine | any) =>
  defHttp.get<BasLine>({ url: adminPath + '/bas/mes/workline/basLine/list', params });

export const basLineListData = (params?: BasLine | any) =>
  defHttp.post<Page<BasLine>>({ url: adminPath + '/bas/mes/workline/basLine/listData', params });

export const basLineForm = (params?: BasLine | any) =>
  defHttp.get<BasLine>({ url: adminPath + '/bas/mes/workline/basLine/form', params });

export const basLineSave = (params?: any, data?: BasLine | any) =>
  defHttp.postJson<BasLine>({ url: adminPath + '/bas/mes/workline/basLine/save', params, data });

export const basLineDisable = (params?: BasLine | any) =>
  defHttp.get<BasLine>({ url: adminPath + '/bas/mes/workline/basLine/disable', params });

export const basLineEnable = (params?: BasLine | any) =>
  defHttp.get<BasLine>({ url: adminPath + '/bas/mes/workline/basLine/enable', params });

export const basLineDelete = (params?: BasLine | any) =>
  defHttp.get<BasLine>({ url: adminPath + '/bas/mes/workline/basLine/delete', params });

export const basLineListTreeData = (params?: BasLine | any) =>
  defHttp.post<Page<BasLine>>({ url: adminPath + '/bas/mes/workline/basLine/treeData', params });
